home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / objcissu.lha / thread-safe-dispatch < prev    next >
INI File  |  1992-09-15  |  1KB  |  23 lines

  1. [from rms 9/5/92]
  2.  
  3. Regarding making the run-time thread-safe: here is an idea for doing
  4. it.  Please save it for whoever wants to implement it.
  5.  
  6. We need interlocking on the routines for altering classes or methods,
  7. but we don't want to have any locking in the method lookup routines,
  8. because that would slow them down.
  9.  
  10. So interlock the redefinition routines so that only one redefinition
  11. operation can be in progress at any time.  Redefining a class should
  12. work by computing an entirely new method dispatch table for the
  13. class.  After the table is fully set up, store its address into the
  14. class object.  All the while, other threads can be looking up
  15. methods.  Until the new address is stored, the other threads get the
  16. old class definition, consistently.  After the new address is stored,
  17. other threads get the new class definition, consistently.  Storing the
  18. pointer is an atomic operation, so there is no need to interlock it
  19. against lookups.
  20.  
  21. There is no reason to have an option to turn off locking.  Locking
  22. will only affect redefinition, which does not need to be ultra fast.
  23.